home *** CD-ROM | disk | FTP | other *** search
/ EDUCORP 8 / Educorp2Compilation.sit / educorp2 / Demos / PEGASYS II Demo / Macros / AngleCalc next >
Encoding:
Text File  |  1988-08-04  |  1.3 KB  |  43 lines

  1. {--------------------------- Angle Calc --------------------------
  2.  
  3. {    This Macro calculates the included angle of three point that you locate.
  4.  
  5. {    Remember the first point in variable &Pt1 and put a point marker there
  6.         Prompt `Locate first point:` &pt1 Coord
  7.         Pt [&Pt1|;]
  8.         
  9. {    Remember the second point in variable &Pt2 and put a point marker there
  10. {    Remember the angle from &Pt1 to &Pt2 in variable #Angle1
  11.         Prompt `Locate second point:` &pt2 Coord
  12.         #Angle1 = %cd.angle
  13.      Pt [&Pt2|;]    
  14.    If (#Angle1 < 0), #Angle1=#Angle1+180
  15.    LL,B,A,.125,.0625 [&pt1|&pt2|;]
  16.  
  17. {    Remember the third point in variable &Pt3 and put a point marker there
  18. {    Remember the angle from &Pt2 to &Pt3 in variable #Angle2
  19.         Prompt `Locate third point:` &pt3 Coord
  20.         #Angle2 = %cd.angle
  21.         Pt [&Pt3|;]
  22.     LL,B,A,.125,.0625 [&pt2|&pt3|;]
  23.  
  24.    If (#Angle2 < 0), #Angle2=#Angle2+180    
  25.  
  26. {    Delete the point markers
  27.         Delete [-|-|-|-|-|;]
  28.  
  29. {    Calculate difference between the two angles,
  30. {    make the number positive and remember it in the variable #A
  31.    If (#Angle1 > #Angle2), Goto FIG:
  32.    #A = #Angle2 - #Angle1
  33.    Goto END:
  34. FIG:
  35.    #A = #Angle1 - #Angle2
  36. END:
  37. {    Issue a message to the operator to tell him what the angle was
  38. Message \The included angle is: #A   Remembered in variable `#A`.\ Time=0
  39.     
  40.     Return
  41.     
  42.  
  43.